import * as React from "react";
import { useBanner } from "../../store/banner";
import { useCounter } from "../../store/counter";
export interface ICompAProps {}

export default function CompA(props: ICompAProps) {
  const counter = useCounter((state) => state);
  const { banner } = useBanner((state) => state);
  return (
    <div className="box">
      <h1>A组件,{counter.count}</h1>
      {banner.map((item) => {
        return (
          <img
            src={item.img}
            key={item.objectId}
            alt=""
            style={{ height: "50px" }}
          />
        );
      })}
    </div>
  );
}
